<template>
  <smart-table
    :title="documentTitle"
    :formList="documentFormList"
    :selectUrl="documentSelectUrl"
    :insertUrl="documentInsertUrl"
    :updateUrl="documentUpdateUrl"
    :deleteUrl="documentDeleteUrl"
    :exportExcelUrl="documentExportUrl"
    :importExcelUrl="documentImportUrl"
    :tableColumns="documentTableColumns"
    :formButtonCtl="documentFormButtonCtl"
    :formRules="documentFormRules" />
</template>

<script>
export default {
  data() {
    return {
      //主题
      documentTitle: '资讯',
      //表单列表
      documentFormList: [
        {
          title: '资讯名',
          name: 'name',
          type: 'input',
          width: 80,
        },
      ],
      //资讯查询路径
      documentSelectUrl: 'document/lookDocuments',
      //资讯新增路径
      documentInsertUrl: 'document/addOneDocument',
      //资讯更新路径
      documentUpdateUrl: 'document/updateOneDocument',
      //资讯删除路径
      documentDeleteUrl: 'document/deleteDocuments',
      //导出路径
      documentExportUrl: '/documentService/document/export',
      //导入路径
      documentImportUrl: '/documentService/document/import',
      //表格列
      documentTableColumns: [
        {
          title: '资讯名',
          name: 'name',
          width: 180,
        },
        {
          title: '创建时间',
          name: 'createTime',
          width: 180,
        },
        {
          title: '修改时间',
          name: 'updateTime',
          width: 180,
        },
      ],
      //表单按钮控制
      documentFormButtonCtl: {
        detailButton: false,
      },
      //表单校验
      documentFormRules: {
        name: [
          {
            required: true,
            message: '资讯名不得为空!',
            trigger: 'blur',
          },
        ],
      },
    }
  },
}
</script>

<style lang="scss" scoped></style>
